package com.example.demo.controller;

import com.example.demo.mapper.DemoMapper;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;
import java.util.Map;

/**
 * Created by xsy-rival on 2018/7/14
 */

@Controller
public class IndexPageController {

    @Autowired
    DemoMapper dm;

    @GetMapping("/index")
    public String index(Model model) {

        List<Map> list = dm.mixSelect();

        model.addAttribute("name", "luguo");

        model.addAttribute("list1", list);

        return "index";
    }

}
